<%@ page contentType="text/html" language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib  uri="/struts-tags" prefix="s"%>
<h2 class="contentTitle">添加任务</h2>
<div class="pageContent">
<s:if test="%{tab == 'editMsg'}">
 <form method="post" action="projectmanagement/taskManageEditUpdate" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone)">
</s:if>
<s:else>
 <form method="post" action="projectmanagement/TaskManageUpdate" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone)">
</s:else>
    <!-- 隐藏域开始 -->
    <input type="hidden" name="b_T_Ufp_TaskManager.taskid" value="${b_T_Ufp_TaskManager.taskid}" />
    <input type="hidden" name="flag" value="${flag}"/>
    <!-- 隐藏域结束 -->
    	<div class="pageFormContent" layoutH="97">
    		<p>
				<label>任务名称：</label>
                <input type="text"  size="32" name="b_T_Ufp_TaskManager.taskName" value="${b_T_Ufp_TaskManager.taskName}" class="required"/><span class="info">必填</span>
			</p>
    		<p>
				<label>任务类型：</label>
				 <input type="text" size="32" name="b_T_Ufp_TaskManager.taskType" value="${b_T_Ufp_TaskManager.taskType}"/>
			</p>
			<p>
				<label>指&nbsp;&nbsp;派&nbsp;&nbsp;人：</label>
                <input type="text"  size="32" name="b_T_Ufp_TaskManager.sentPeople" value="${b_T_Ufp_TaskManager.sentPeople}" readOnly="true"/>
                <!--  <a class="btnLook" href="investment/StaffCallbacks?lookup=1" lookupGroup="b_T_Ufp_TaskManager">查找带回</a>-->
			</p>
			<p>
				<label>被指派人：</label>
                <input type="text"  size="32" name="b_T_Ufp_TaskManager.accusedPeople" value="${b_T_Ufp_TaskManager.accusedPeople}" class="required"/><span class="info">必填</span>
                <a class="btnLook" href="investment/StaffCallbackss?lookup=1" lookupGroup="b_T_Ufp_TaskManager">查找带回</a>
			</p>
			
			<p>
				<label>所属项目：</label>
				<input type="hidden"  size="32" name="b_T_Ufp_TaskManager.projectUuid" value="${b_T_Ufp_TaskManager.projectUuid}"/>
                <input type="text"  size="32" name="b_T_Ufp_TaskManager.respectiveProject" value="${b_T_Ufp_TaskManager.respectiveProject}"/>
                <a class="btnLook" href="projectmanagement/TaskManageListCallBack?lookup=1&flag=1" lookupGroup="b_T_Ufp_TaskManager">查找带回</a>
			</p>
			<p>
				<label>优&nbsp;&nbsp;先&nbsp;&nbsp;级：</label>
                <s:select label="优先级" headerKey="" headerValue="--请选择--" list="#{0:'1级',1:'2级',2:'3级',3:'4级',4:'5级',5:'6级',6:'7级',7:'8级',8:'9级',19:'10级'}" name="b_T_Ufp_TaskManager.priority" cssStyle="height:22px;width:193px;"/>
			</p>
			<p>
				<label>严重程度：</label>
                <s:select label="严重程度" headerKey="" headerValue="--请选择--" list="#{0:'1级',1:'2级',2:'3级',3:'4级',4:'5级',5:'6级',6:'7级',7:'8级',8:'9级',19:'10级'}" name="b_T_Ufp_TaskManager.seriousness" cssStyle="height:22px;width:193px;"/>
			</p>
			
			<p>
				<label>任务计划开始时间：</label>
                <input type="text"  size="29" name="b_T_Ufp_TaskManager.taskStartTime" value="${b_T_Ufp_TaskManager.taskStartTime}" readonly="true" class="date" /><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
			<p>
				<label>任务计划结束时间：</label>
                <input type="text"  size="29" name="b_T_Ufp_TaskManager.taskEndTime" value="${b_T_Ufp_TaskManager.taskEndTime}"  readonly="true" class="date" /><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
			<p>
				<label>任务计划用时：</label>
                <input type="text"  size="20"  name="b_T_Ufp_TaskManager.taskPlanWill"  value="${b_T_Ufp_TaskManager.taskPlanWill}" class="number" /><span class="info">单位：小时</span>
			</p>
			<p>
				<label>任务实际开始时间：</label>
                <input type="text"  size="29" name="b_T_Ufp_TaskManager.taskActualStartTime"  value="${b_T_Ufp_TaskManager.taskActualStartTime}" format="yyyy-MM-dd HH:mm:ss" readonly="true"/><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
			<p>
				<label>任务实际结束时间：</label>
                <input type="text"  size="29" name="b_T_Ufp_TaskManager.taskActualEndTime" value="${b_T_Ufp_TaskManager.taskActualEndTime}" format="yyyy-MM-dd HH:mm:ss" readonly="true" /><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
			<p>
				<label>任务实际用时：</label>
                <input type="text"  size="32" name="b_T_Ufp_TaskManager.taskActualTimeSpent" readOnly="true" value="${b_T_Ufp_TaskManager.taskActualTimeSpent}" />
			</p>
			<dl class="nowrap" id="relx">
					<dt>附件：</dt>
						<dd>
						<a class="btnAttach" href="projectmanagement/fileTypeLists?moduleName=project&auxiliaryId=${b_T_Ufp_TaskManager.taskid}&projectUuid=${b_T_Flow_ProjectManagement.projectUuid}" target="dialog" width="600" height="500" title="上传附件" ></a>
						<span id="result"></span>
							<c:forEach items="${pagerFile.pageRecords}" var="c_T_Sys_File" varStatus="s">
								<tr target="sid_obj" rel="1">
									<td>${s.count +pagerFile.pageSize*(pagerFile.currentPage-1)}.</td>
									<!-- <td><a href="projectmanagement/download?fileName=${c_T_Sys_File.fileName}" title="文件另存为"><font color="blue">${c_T_Sys_File.fileName}</font></a></td> -->
									<td><a href="${c_T_Sys_File.fileUflPath}" title="文件另存为"><font color="blue">${c_T_Sys_File.fileTime}-->${c_T_Sys_File.createUser}-->${c_T_Sys_File.fileName}</font></a></td>
									<td><a href="javascript:void(0);" onClick="return del('${c_T_Sys_File.fileName}','${c_T_Sys_File.fileId}','');"  title="确定要删除吗?"><img src="dwz/uploadify/cancel.png" border="0"></a><br /></td>
								</tr>
							</c:forEach>
					</dd>
			</dl>
			<div class="unit">
			<p>
				<label>描&nbsp;&nbsp;&nbsp;&nbsp;述：</label>
			</p>
				 <textarea rows="12" cols="111" name="b_T_Ufp_TaskManager.taskBewrite" class="editor" upImgUrl="costomer/Update" upImgExt="jpg,jpeg,gif,png" 
         >${b_T_Ufp_TaskManager.taskBewrite}</textarea>
			</div>
			<div class="unit">
			<p>
				<label>备&nbsp;&nbsp;&nbsp;&nbsp;注：</label>
			</p>
				 <textarea rows="12" cols="111" name="b_T_Ufp_TaskManager.remark" class="editor" upImgUrl="costomer/Update" upImgExt="jpg,jpeg,gif,png" 
         >${b_T_Ufp_TaskManager.remark}</textarea>
			</div>
			</div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit" id="submit1">
                               保存
                            </button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">
                                取消
                            </button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
	function del(fileName,id,unm){
		jQuery.ajax( {
			async : false,
            cache : false,
            type : 'POST',
            dataType : "json",
            url : 'projectmanagement/fileDelete?checkIds='+id,
            error : function() {//请求失败处理函数  
                    alert('请求失败');
                },
                success : function(data) { //请求成功后处理函数。
                	//dump_obj(data);
                if(unm != ""){
                	$("#"+unm).remove();
                }else{
                	var takid = '${b_T_Ufp_TaskManager.taskid}';
                   $("#relx").load("projectmanagement/TaskManageDital?b_T_Ufp_TaskManager.taskid="+takid+"&flag=2"+" #relx>*");
                   /**
                   	$("#relx").load(location.href+" #relx>*");
                   	注意：
                   	1.location.href 看时机用，如果会出现丢失html现象，请改为自己的URL 如："projectmanagement/TaskManageDital?b_T_Ufp_TaskManager.taskid="+takid+"&flag=2"
                   	2.+" #relx>*") 这里 请用 双引号，有可能也会出现如上错误，在选择器 前面必须加空格
                   */
                }
			}
        });
	}
	//打印json数据
	function dump_obj(myObject) {
		  var s = "";
		  for (var property in myObject) {
		   s = s + "\n "+property +": " + myObject[property] ;
		  }
		  alert(s);
		}
</script> 